package com.javafactroy.kunlong.data.entity;

import lombok.Data;

import com.javafactroy.kunlong.client.feign.dto.PageInfoDto;

import javax.persistence.Column;
import javax.persistence.*;
//import javax.persistence.Id;

import lombok.experimental.Accessors;
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import io.swagger.annotations.ApiModel;
import com.alibaba.excel.annotation.write.style.ColumnWidth;

import io.swagger.annotations.ApiModelProperty;

/**
 * @author raymond.lei@163.com
 * @date 2023-11-27 17:25:32
 * @file SysAppApiEntity.java
 * @company com.javafactroy.kunlong
 */
@Data
@Table(name = "sys_app")
@ApiModel("子系统表")
@Accessors(chain = true)
@ExcelIgnoreUnannotated
@ColumnWidth(18)
public class SysAppApiEntity extends PageInfoDto {
    private static final long serialVersionUID = 1L; //一会就说这个是做什么的

    // 子系统标识号 dataType:int
    @ApiModelProperty(name = "子系统标识号")
    @ExcelProperty("子系统标识号")
    @Column(name = "app_id")
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY, generator = "Mysql")
    Integer appId;

    // app_no dataType:varchar
    @ApiModelProperty(name = "")
    @ExcelProperty("app_no")
    @Column(name = "app_no")
    String appNo;

    // 子系统名称 dataType:varchar
    @ApiModelProperty(name = "子系统名称")
    @ExcelProperty("子系统名称")
    @Column(name = "app_name")
    String appName;

    // 子系统 dataType:varchar
    @ApiModelProperty(name = "子系统")
    @ExcelProperty("子系统")
    @Column(name = "remark")
    String remark;

    // ip dataType:varchar
    @ApiModelProperty(name = "")
    @ExcelProperty("ip")
    @Column(name = "ip")
    String ip;

    // port dataType:int
    @ApiModelProperty(name = "")
    @ExcelProperty("port")
    @Column(name = "port")
    Integer port;

    // type dataType:varchar
    @ApiModelProperty(name = "")
    @ExcelProperty("type")
    @Column(name = "type")
    String type;

    public Boolean checkInsertFlag() {
        return appId == null;
    }

}